<?php

class Site_AuthTool
{

    public static function checkToken($post_data, $token, $salt)
    {
        if (empty($post_data)) {
            return false;
        }
        $token_str = '';
        ksort($post_data);
        foreach ($post_data as $val) {
            $token_str .= $val;
        }
        $token_str .= $salt;
        $token_str = md5(md5($token_str));
        return $token_str === $token;
    }
}